#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>

int main(int argc, char const *argv[]) {
  int fd;
  fd = open("inputfile.txt", O_RDONLY);

  if (fd == -1) {
    if (errno == EINTR) {
      fprintf(stderr, "open file was interrupted by a signal\n");
    } else {
      /* The open failed. Print an error message and exit. */
      fprintf(stderr, "error opening file: %s\n", strerror(errno));
      perror("open");
      exit(1);
    }
  }

  return 0;
}
